package com.zhmsky.mybatisplus_02.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


import java.net.InterfaceAddress;
import java.util.Date;

/**
 * @author zhmsky
 * @date 2021/11/30 21:51
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {

    @TableId(type = IdType.ASSIGN_ID)  //对应数据库中的主键(自增id)
    private Long id;

    private String username;
    private Integer age;
    private String email;

    @Version   //代表是乐观锁
    private Integer version;

    @TableLogic  //逻辑删除
    private Integer deleted;

    @TableField(fill = FieldFill.INSERT)  //自动填充
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
}
